<!DOCTYPE html>
<html>
<head>
    <title>消息群发</title>
    <#include "/header.html">
    <style>
        #selectBrandName, #pushHeadId {
            width: 60%;
            display: inline-block;
        }

        #brandId, #query {
            width: 38%;
            display: inline-block;
            float: right;
        }

        #pushHeadtb {
            width: 100%;
            background-color: lightblue;
        }

        #pushHeadtb, #pushHeadtb th, #pushHeadtb td {
            border: 1px solid #000;
            text-align: center;
            padding: 4px;
        }

        #pushHeadtb th {
            font-weight: bold;
        }
    </style>
</head>
<body>
    <div id="rrapp" v-cloak>
        <div v-show="showList" class="panel panel-default">
            <form class="form-horizontal" style="margin: auto;">
                <div class="form-group">
                    <div class="col-sm-2 control-label">公众号</div>
                    <div class="col-sm-10">
                        <select style="height: 34px; width: 100%" id="allGzhCodes" v-model="q.gzhCode">

                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label">品牌</div>
                    <div class="col-sm-10">
                        <input class="form-control" list="allBrandNames" placeholder="请选择品牌" id="selectBrandName" v-model="q.brandName" @change="updateBrand">
                        <datalist id="allBrandNames" style="line-height: 10px">

                        </datalist>
                        <input class="form-control" id="brandId" v-model="q.brandId" readonly>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label">文章ID</div>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="articleId" v-model="q.articleId" placeholder="文章ID" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label">用户ID</div>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="userId" v-model="q.userId" placeholder="用户ID" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-6 control-label" style="text-align: center">
                        <input type="button" class="btn btn-primary" @click="sendMessagingTest" value="测试" id="sendMessagingTest" />
                    </div>
                    <div class="col-sm-6 control-label" style="text-align: center">
                        <input type="button" class="btn btn-primary" @click="sendMessaging" value="发送" id="sendMessaging" />
                    </div>
                </div>
                <hr style="border: 1px solid #000" />
                <div class="form-group">
                    <div class="col-sm-6 control-label" id="notice"></div>
                    <div class="col-sm-6"></div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label">ID</div>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="pushHeadId" v-model="q.pushHeadId" />
                        <input type="button" class="btn btn-primary" @click="query" value="查询" id="query" />
                    </div>
                </div>
            </form>
        </div>
        <div v-show="!showList" class="panel panel-default">
            <table id="pushHeadtb">
                <tr>
                    <th colspan="8">推送消息日志(头信息)</th>
                </tr>
                <tr>
                    <th>任务名称：</th>
                    <td id="pushName"></td>

                    <th>消息类型：</th>
                    <td colspan="3" id="msgTypeName"></td>

                    <th>发送日期：</th>
                    <td id="createTime"></td>
                </tr>
                <tr>
                    <th>成功数：</th>
                    <td id="successCount"></td>

                    <td colspan="4"></td>

                    <th>运行结束时间：</th>
                    <td id="endTime"></td>
                </tr>
                <tr>
                    <th>失败数：</th>
                    <td id="failCount"></td>

                    <td colspan="6"></td>
                </tr>
                <tr>
                    <th>报错数：</th>
                    <td id="errCount"></td>

                    <td colspan="6"></td>
                </tr>
            </table>
        </div>
        <div v-show="!showList" class="panel panel-default">
            <p style="font-weight: bold">推送消息日志(详情)</p>
            <table id="jqGrid"></table>
            <div id="jqGridPager"></div>
        </div>
    </div>
    <script src="${request.contextPath}/statics/js/modules/sys/messaging.js?_${.now?long}"></script>
</body>
</html>